﻿using System;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;

namespace DIS.WindowsPhone.Toolkit.Converters
{
    public class GroupItemBackground : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null || !(bool)value)
                return Application.Current.Resources["PhoneChromeBrush"];
            else
                return Application.Current.Resources["PhoneAccentBrush"];

        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }

    public class GroupItemForeground : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null || !(bool)value)
                return Application.Current.Resources["PhoneDisabledBrush"];
            else
                return new SolidColorBrush(Colors.White);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }
}
